<?php
class EvaluateAction extends Action {
	function _initialize() {
		$this->assign ( "menuFirst", session ( 'menuFirst' ) );
		$this->assign ( "menuSecond", session ( 'menuSecond' ) );
	}
	function clist() {
		// 超级管理员权限
		if (session ( "info.rid" ) != '1') {
			$this->redirect ( '/Admin/Console/index' );
			return;
		}
		
		$ob = D ( "Fortune" );
		$map = array ();
		
		$cpp = 10; // 分页数
		import ( 'ORG.Util.Page' ); // 导入分页类
		$count = $ob->where ( $map )->count (); // 查询满足要求的总记录数
		$Page = new Page ( $count, $cpp ); // 实例化分页类 传入总记录数和每页显示的记录数
		$show = $Page->show (); // 分页显示输出
		$xuhao = $Page->firstRow;
		
		$list = $ob->where ( $map )->order ( 'fid desc' )->limit ( $Page->firstRow . ',' . $Page->listRows )->getlist ();
		
		$this->assign ( "list", $list );
		$this->assign ( 'show', $show ); // 赋值分页输出
		$this->assign ( "xuhao", $xuhao );
		$this->display ( "Evaluate/clist" );
	}
}